package com.ganzi.manager.util;

import com.ganzi.manager.base.BaseResponse;

import java.util.HashMap;
import java.util.Map;

public class ReturnMap {


    public static BaseResponse getReturnMap(int code, String msg){
        return new BaseResponse(getReturnMapData(code,msg,null));
    }
    public static Map getReturnMapData(int code, String msg,Object data){
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("code", code);
        map.put("msg", msg);
        map.put("data", data);
        return map;
    }

    public static Map getReturnMapDataForPage(int code, String msg,Object data,int totalPage,int currentPage){
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("code", code);
        map.put("msg", msg);
        map.put("data", data);
        map.put("totalPage", totalPage);
        map.put("currentPage", currentPage);
        return map;
    }
}
